package drds.global_transaction.resource_manager.sql_recognizer;

public enum SqlType
{
	select(0), insert(1), update(2), delete(3), select_for_update(4), replace(5), truncate(6), create(7), drop(8), load(9), merge(10), show(11), alter(12), rename(13), dump(14), debug(15), explain(16), procedure(17), desc(18), select_last_insert_id(19), select_without_table(20), create_sequence(21), show_sequences(22), get_sequence(23), alter_sequence(24), drop_sequence(25), tddl_show(26), set(27), reload(28), select_union(29), create_table(30), drop_table(31), alter_table(32), save_point(33), select_from_update(34),
	/**
	 * multi delete/update
	 */
	multi_delete(35), multi_update(36), create_index(37), drop_index(38), kill(39), release_dblock(40), lock_tables(41), unlock_tables(42), check_table(43),

	/**
	 * 获取上sql_calc_found_rows 的结果
	 */
	select_found_rows(44),

	// fescar
	insert_ingore(101), insert_on_duplicate_update(102);

	public static SqlType valueOf(int i)
	{
		for (SqlType t : values())
		{
			if (t.value() == i)
			{
				return t;
			}
		}
		throw new IllegalArgumentException("Invalid SqlType:" + i);
	}

	private int i;

	private SqlType(int i)
	{
		this.i = i;
	}

	public int value()
	{
		return this.i;
	}
}
